<template>
  <n-alert title="注意" type="warning"> 因为反向换算问题，会存在精度问题（暂未处理） </n-alert>
  <ConvertLayout :standard="standard" :initial="initial" :selectOptionsList="selectOptionsList" />
</template>

<script setup lang="ts">
import ConvertLayout from "../layout/ConvertLayout.vue";

// 光强换算的标准
const standard = {
  label: "兆字节(MB)",
  value: 1,
};
// 光强换算的初始值
const initial = {
  label: "千字节(KB)",
  value: 1024,
};

// 进制换算的数值类型
const selectOptionsList: ConvertOptionsType = [
  {
    type: "group",
    label: "公制",
    key: "公制",
    children: [
      {
        label: "比特(bit)",
        value: "比特(bit)",
        num: 8388608,
        disabled: false,
      },
      {
        label: "字节(B)",
        value: "字节(B)",
        num: 1048576,
        disabled: false,
      },
      {
        label: "千字节(KB)",
        value: "千字节(KB)",
        num: 1024,
        disabled: false,
      },
      {
        label: "兆字节(MB)",
        value: "兆字节(MB)",
        num: 1,
        disabled: false,
      },
      {
        label: "千兆字节(GB)",
        value: "千兆字节(GB)",
        num: 0.000977,
        disabled: false,
      },
      {
        label: "太字节(TB)",
        value: "太字节(TB)",
        num: 9.54e-7,
        disabled: false,
      },
      {
        label: "拍字节(PB)",
        value: "拍字节(PB)",
        num: 9.31e-10,
        disabled: false,
      },
      {
        label: "艾字节(EB)",
        value: "艾字节(EB)",
        num: 9.09e-13,
        disabled: false,
      },
    ],
  },
];
</script>
